//
//  HasClockcell.m
//  ZHZtest
//
//  Created by 李彦宏 on 2018/1/9.
//  Copyright © 2018年 LYH. All rights reserved.
//

#import "HasClockcell.h"
@interface HasClockcell()

@end
@implementation HasClockcell

/**
 *  cell的初始化方法，一个cell只会调用一次
 *  一般在这里添加所有可能显示的子控件，以及子控件的一次性设置
 */
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //添加UI控件
        [self setUI];
        
    }
    return self;
}
-(void)setUI{
    UILabel *lb1=[[UILabel alloc]init];
    lb1.text=@"李彦宏";
    lb1.font=[UIFont systemFontOfSize:14];
    lb1.textColor=[UIColor blackColor];
    lb1.textAlignment=NSTextAlignmentCenter;
    [self.contentView addSubview:lb1];
    self.sname = lb1;
    
    UILabel *lb2=[[UILabel alloc]init];
    lb2.text=@"打卡详情";
    lb2.font=[UIFont systemFontOfSize:14];
    lb2.textColor=[UIColor blackColor];
    lb2.textAlignment=NSTextAlignmentCenter;
    [self.contentView addSubview:lb2];
    
    UILabel *lb5=[[UILabel alloc]init];
    lb5.text=@"13372666065";
    lb5.textAlignment=NSTextAlignmentCenter;
    lb5.font=[UIFont systemFontOfSize:14];
    lb5.textColor=[UIColor blackColor];
    [self.contentView addSubview:lb5];
    self.sphone = lb5;
    
    NSInteger EMarg=20;
    
    [lb1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(120, 20));
        make.left.equalTo(self.contentView);
        make.top.equalTo(self.contentView).offset(10);
    }];
    [lb5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.centerY.equalTo(lb1);
    }];
    [lb2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(lb1);
        make.right.equalTo(self.contentView).offset(-EMarg);
    }];
}

-(void)setModel:(SDUserModel *)model{
    _model = model;
    self.sname.text = _model.name;
    self.sphone.text = _model.phone;
}
@end
